using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Firestarter.DB.Schema.BO;
using FireStarterModeller.BO;
using Firestarter.DB.Schema.UI;
using NUnit.Framework;

namespace Firestarter.DB.Schema.Test.UI
{
    [TestFixture]
    public class TestApproveModelModificationsWizardStep : TestBase
    {
        [Test]
        public void Test_ReverseEngineering()
        {
            //---------------Set up test pack-------------------
            ApproveModelModificationsWizardStep wizardStep = new ApproveModelModificationsWizardStep();
            ReverseEngineering reverseEngineering = new ReverseEngineering
            {
                StoredDatabase = new DBDatabase()
            };
            //-------------Assert Preconditions -------------

            //---------------Execute Test ----------------------
            wizardStep.ReverseEngineering = reverseEngineering;
            //---------------Test Result -----------------------
            Assert.AreSame(reverseEngineering, wizardStep.ReverseEngineering);
            Assert.AreSame(reverseEngineering.ModelModifications, wizardStep.ModelModifications);
            Assert.AreSame(reverseEngineering.ModelModifications, wizardStep.ModelModificationsControl.ModelModifications);
        }

        [Test]
        public void Test_ReverseEngineering_SetToNull()
        {
            //---------------Set up test pack-------------------
            ApproveModelModificationsWizardStep wizardStep = new ApproveModelModificationsWizardStep();
            wizardStep.ReverseEngineering = new ReverseEngineering { StoredDatabase = new DBDatabase() };
            //-------------Assert Preconditions -------------
            Assert.IsNotNull(wizardStep.ReverseEngineering);
            Assert.IsNotNull(wizardStep.ModelModifications);
            Assert.IsNotNull(wizardStep.ModelModificationsControl.ModelModifications);
            //---------------Execute Test ----------------------
            wizardStep.ReverseEngineering = null;
            //---------------Test Result -----------------------
            Assert.IsNull(wizardStep.ReverseEngineering);
            Assert.IsNull(wizardStep.ModelModifications);
            Assert.IsNull(wizardStep.ModelModificationsControl.ModelModifications);
        }
    }
}
